package com.controller;

import com.entity.Link;
import com.entity.User;
import com.service.ILinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

@Controller
@RequestMapping("/sysLink")
public class LinkController {

    @Autowired
    ILinkService iLinkService;

    @RequestMapping("/getlinklist")
    @ResponseBody
    public List<Link> getlinklist(Link link) {
        List<Link> links = iLinkService.selectLinkList(link);
        return links;
    }

    @RequestMapping("/getauthorauthor")
    @ResponseBody
    public User getauthorauthor(Long lkId){
        List<User> users = iLinkService.selectLinkauthorById(lkId);
        return users.get(0);
    }



}

